require 'rubygems'
gem 'soap4r'
require 'soap/wsdlDriver'
require 'soap/header/simplehandler'
require 'defaultDriver.rb'
require 'authStub.rb'
require 'WSHelpers.rb'

options = nil

props = {
  :object => 'Email',
  :props => ['Name','ID']
}

filter = {
  :filterType => 'Simple',
  :filter => ['Name','equals','API-Test-9']
}

emls = BuildRetrieve.new
resp = emls.creates(props,filter)

id = String.new
customerKey = String.new

resp.results.each do |result|
  id = result.iD
end

emailObj = Email.new(nil,nil,nil,nil,nil,id,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil)
apiObj = emailObj

resp = $driver.delete(DeleteRequest.new(options,[*apiObj]))